package com.bgi.uims.pub.utils;

import java.util.ResourceBundle;
/**
 * 
 * ClassName: ConfigConst <br/>
 * Function: TODO 所有静态资源在此加载. <br/>
 * Reason: TODO ADD REASON(可选). <br/>
 * date: 2014-10-20 下午02:04:14 <br/>
 *
 * @author fukun
 * @version 
 * @since JDK 1.7
 */
public class ConfigConst {

	private static String DB_SQL_PROPERTIES = "config/jdbc";
	private static ResourceBundle DBSQL = null;
	private static final String DB_JDBC_DRIVERCLASSNAME = "jdbc.driverClassName";
	private static final String DB_JDBC_URL = "jdbc.url";
	private static final String DB_JDBC_USERNAME = "jdbc.username";
	private static final String DB_JDBC_PASSWORD = "jdbc.password";
	private static String JDBC_DRIVERCLASSNAME = "";
	private static String JDBC_URL = "";
	private static String JDBC_USERNAME = "";
	private static String JDBC_PASSWORD = "";

	private static ResourceBundle log4j = null;
	private static String LOG4J_PROPERTIES = "log4j";
	private static String SQLLOGPATH = "myLogger.log.dir";
	private static String SQLLOG_PATH = null;
	
	private static ResourceBundle configRb = null;
	private static String CONFIGCONST_PROPERTIES = "config";
	private static String AUTOPASSWORD = "auto.password";
	private static String AUTO_PASSWORD = null;
	private static String AUTHEMAIL = "auth.email";
	private static String AUTH_EMAIL = null;
	
	private static ResourceBundle messagesRb = null;
	private static String MESSAGESCONST_PROPERTIES = "messages";
	private static String REGISTER = "app.phonemessage.register";
	private static String REGISTER_VALUE = null;
	private static String VERIFICATIONCODE = "app.phonemessage.verificationcode";
	private static String VERIFICATION_CODE = null;
	
	static {
		try {
			// jdbc
			DBSQL = ResourceBundle.getBundle(DB_SQL_PROPERTIES);
			JDBC_DRIVERCLASSNAME = DBSQL.getString(DB_JDBC_DRIVERCLASSNAME);
			JDBC_URL = DBSQL.getString(DB_JDBC_URL);
			JDBC_USERNAME = DBSQL.getString(DB_JDBC_USERNAME);
			JDBC_PASSWORD = DBSQL.getString(DB_JDBC_PASSWORD);
			// 日志路径
			log4j = ResourceBundle.getBundle(LOG4J_PROPERTIES);
			SQLLOG_PATH = log4j.getString(SQLLOGPATH);
			// 常用配置
			configRb = ResourceBundle.getBundle(CONFIGCONST_PROPERTIES);
			AUTO_PASSWORD = (configRb.getString(AUTOPASSWORD));
			AUTH_EMAIL=configRb.getString(AUTHEMAIL);
			//消息配置
			messagesRb = ResourceBundle.getBundle(MESSAGESCONST_PROPERTIES);
			REGISTER_VALUE = (messagesRb.getString(REGISTER));
			VERIFICATION_CODE = (messagesRb.getString(VERIFICATIONCODE));
			
		} catch (Exception e) {

		}
	}

	public static String getJDBC_DRIVERCLASSNAME() {
		return JDBC_DRIVERCLASSNAME;
	}

	public static String getJDBC_URL() {
		return JDBC_URL;
	}

	public static String getJDBC_USERNAME() {
		return JDBC_USERNAME;
	}

	public static String getJDBC_PASSWORD() {
		return JDBC_PASSWORD;
	}

	public static String getSQLLOG_PATH() {
		return SQLLOG_PATH;
	}

	public static String getAUTO_PASSWORD() {
		return AUTO_PASSWORD;
	}

	public static String getREGISTER_VALUE() {
		return REGISTER_VALUE;
	}

	public static String getVERIFICATION_CODE() {
		return VERIFICATION_CODE;
	}

	public static String getAUTH_EMAIL() {
		return AUTH_EMAIL;
	}
	
	
	
}
